package com.imike.akka;

import akka.actor.UntypedActor;

public class StudentActor extends UntypedActor {

    @Override
    public void onReceive(Object msg) throws Exception {
        
        Thread.sleep(1000);
        if(msg.equals("get")) {
            this.getSender().tell(getStudent(), getSelf());
        }
        
    }
    
    private Student getStudent() {
        
        Student s = new Student();
        
        s.setAge(18);
        s.setGender("male");
        s.setId(1);
        s.setName("路明非");
        
        return s;
    }

}
